from app import db

class User(db.Model):
    #对应MySQL中数据表的名字
    __tablename__ = "user"

    #创建字段
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.String(50), nullable=False)
    name = db.Column(db.String(50), nullable=False)
    pwd = db.Column(db.String(100))
    email = db.Column(db.String(100), nullable=False)
    avatar = db.Column(db.String(200))
    desc = db.Column(db.String(300))

    def __repr__(self):
        return f"<User {self.name}, email: {self.email}>"



